Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShowInTaskBar with Owned window: make consistent with WPF #12593

Merged
merged 1 commit into from
Aug 19, 2023

Conversation

danwalmsley
Copy link
Member

@danwalmsley danwalmsley commented Aug 19, 2023

Repro

var window = CreateSampleWindow();

window.ShowInTaskbar = false;

window.Show(GetWindow());

window.Loaded += (sender, args) => { window.ShowInTaskbar = true; };

Current behavior (windows only)
When the loaded event happens, it will just remove the owner window. Meaning that the dialog will go behind the main window.

I checked WPFs behavior and it definately ignores ShowInTaskBar changes in this scenario.

  1. ShowInTaskBar = false, causes SetParent to be called and parent set to HiddenWindow.Handle, and _hiddenWindowIsParent = true;

  2. Show gets called, SetParent sets the new owner. all good.

  3. ShowInTaskbar gets set to true, but because _hiddenWindowIsParent was left true, it overwrites the owner window.
    casuing the issue.

Fixed behavior:

ensure _hiddenWindowIsParent is always in sync.
ShowInTaskbar is ignored and relationship maintained.

…lready shown, not remove the ownership

This makes us consistent with WPF.
@danwalmsley danwalmsley enabled auto-merge August 19, 2023 12:42
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0038580-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@danwalmsley danwalmsley added this pull request to the merge queue Aug 19, 2023
Merged via the queue into master with commit 708151f Aug 19, 2023
@danwalmsley danwalmsley deleted the fixes/win32-show-in-taskbar-on-owner-window branch August 19, 2023 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants